<!--  -->
<template>
  <div class="bottom-bar">
    <div class="bar-item bar-left">
      <div>
        <!-- <i class="icon service"></i> -->
        <img class="icon" src="~assets/img/detail/icon01.png" alt="">
        <p class="text">客服</p>
      </div>
      <div>
        <img class="icon" src="~assets/img/detail/icon02.png" alt="">
        <p class="text">店铺</p>
      </div>
      <div>
        <img class="icon" src="~assets/img/detail/icon03.png" alt="">
        <p class="text">收藏</p>
      </div>
    </div>
    <div class="bar-item bar-right">
      <div class="cart" @click="addToCart">加入购物车</div>
      <div class="buy">购买</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DetailBottomBar',
  data() {
    return {

    }
  },
  // 生命周期 - 创建完成（访问当前this实例）
  created() {

  },
  // 生命周期 - 挂载完成（访问DOM元素）
  mounted() {

  },
  methods:{
    addToCart() {
      console.log('监听点击')
      this.$emit('addCar')
    }
  }
}
</script>
<style scoped>
/* @import url(); 引入css类 */
.bottom-bar{
  position: relative;
  bottom: 49px;
  height: 49px;
  background-color: #fff;
  z-index: 222;
  display: flex;
  text-align: center;
}
.bar-item{
  flex: 1;
  display: flex;
}
.bar-item>div{
  flex: 1;
}
.bar-left .text{
  font-size: 13px;
}
.bar-left .icon{
  width: 26px;
}
.bar-right{
  font-size: 15px;
  color: #fff;
  line-height: 58px;;
}
.bar-right .cart{
  background-color: #ffe817;
  color: #333;
}
.bar-right .buy{
  background-color: #f69;
}
</style>
